package com.dxg.msns.common.pojo;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import java.io.Serializable;

/**
 * 音乐类型实体类
 * 对应数据库表：music_type
 * 
 * @author system
 */
@Table(name = "music_type")
public class MusicType implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 音乐分类ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 分类名
     */
    @Column(name = "type_name")
    private String typeName;

    /**
     * 分类状态
     */
    @Column(name = "type_status")
    private String typeStatus;

    // 构造方法
    public MusicType() {
    }

    public MusicType(String typeName) {
        this.typeName = typeName;
        this.typeStatus = "1";
    }

    // Getter 和 Setter 方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeStatus() {
        return typeStatus;
    }

    public void setTypeStatus(String typeStatus) {
        this.typeStatus = typeStatus;
    }

    @Override
    public String toString() {
        return "MusicType{" +
                "id=" + id +
                ", typeName='" + typeName + '\'' +
                ", typeStatus='" + typeStatus + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        MusicType musicType = (MusicType) o;

        return id != null ? id.equals(musicType.id) : musicType.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}